/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.p10.miage.gestionabsence.model;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author huynal
 */
public class EC {
    
    private int idEc;
    private String nom;
    private String code;

    public EC() {
    }

    public EC(int idEc, String nom, String code) {
        this.idEc = idEc;
        this.nom = nom;
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getIdEc() {
        return idEc;
    }

    public void setIdEc(int idEc) {
        this.idEc = idEc;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }
    
    public void init(ResultSet resultat) throws SQLException{
        this.idEc = resultat.getInt("IDEC");
        this.nom = resultat.getString("NOM");
        this.code = resultat.getString("CODE");
    }
}
